<script setup>
import { ref } from 'vue'
import { emitter } from './eventBus.js'

const count = ref(0)
const add = () => {
  count.value++
  emitter.emit('share-number', count.value)
}
</script>

<template>
  <div class="box-left">
    <h5>数据发送方 --- {{ count }}</h5>
    <hr />

    <button @click="add">+</button>
  </div>
</template>

<style scoped>
h5 {
  margin: 0;
  padding: 0;
}
.box-left {
  background-color: orange;
  padding: 15px;
  box-sizing: border-box;
  min-height: 200px;
  flex: 1;
}
</style>
